/** 全局中间件 */

const express = require("express");
const fs = require("fs");
const path = require("path");
const app = express();


app.use((req,res,next)=>{
  console.log('req',req.headers);
  const referer = req.get('referer')

  console.log(referer);
  next()
})

app.get("/", (req, res) => {
  // console.log(req.hostname);
  res.send("首页");
});

app.get("/home", (req, res) => {
  res.send("home");
});

app.get("/index", (req, res) => {
  res.send("index");
});

app.listen(3001, () => {
  console.log(" 3001 server start");
});
